package com.nt.thah.controller;

import com.alibaba.fastjson.JSONObject;
import com.nt.thah.requestparam.BaseParam;
import com.nt.thah.service.UserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Map;

/**
 * @Description: 用户管理
 * @author: ls
 * @Date: 2020/7/8 16:12
 */
@Api(tags = "用户管理")
@RestController
@RequestMapping("/user")
@Validated
public class UserController {

    @Resource
    private UserService userServiceImpl;

    @ApiOperation(value = "获取用户信息")
    @PostMapping("/getList")
    public Map<String, Object> getList(BaseParam param) {
        return userServiceImpl.getList(param);
    }

    @ApiOperation(value = "获取oss临时授权的sts信息")
    @PostMapping("/getOssStsInfo")
    public JSONObject getOssStsInfo() {
        return userServiceImpl.getOssStsInfo();
    }

    @ApiOperation(value = "获取统计数据")
    @PostMapping("/getStatisticsData")
    public Map<String, Object> getStatisticsData(BaseParam param) {
        return userServiceImpl.getStatisticsData(param);
    }

}
